<template>
    <div>
        <div class="pay">
<!--            <p>1.使用系统浏览器打开页面</p>-->
<!--            <p>2.点击支付</p>-->
            <button @click="pay" style="width: 160px;height: 160px;font-size: 18px;">使用系统浏览器点击支付</button>
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                order_no: '',
                isLock: false,
            }
        },
        created() {
        },
        mounted() {

        },
        methods: {
            pay() {
                if (!this.isLock) {
                    let order_no = this.$route.params.order_no;
                    let that = this;
                    that.isLock = true;
                    this.api.postAliPay(order_no).then(res => {
                        that.isLock = false;
                        if (res.meta.code != '000') {
                            alert(res.meta.msg);
                            return;
                        }
                        if (res.data) {
                            window.location.href = res.data.code_url;
                        }
                    });
                }

            },
        },
    }
</script>
<style>
    .pay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        /*background-color: gray;*/
        /*color: #fff;*/
    }


</style>
